﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using UserManage;


public partial class ImageDisplay : System.Web.UI.Page
{   
    UserManager _imageDisplayManager = new UserManager();
    protected void Page_Load(object sender, EventArgs e)
     {
         try
         {
             DataSet ds;
             string userID = string.Empty;
            // _imageDisplayManager.ImageLoad(Session["UserManager_PersonalID"].ToString(), out ds);
          
             //if (Session["UserManager_Edit"].ToString() == "User Edit")
                // userID=((string[])Session["UserManager_IDs"])[0].ToString();
             userID = "1";
             _imageDisplayManager.ImageLoad(userID, out ds);
             
             if (ds.Tables[0].Rows[0]["UD_Photo"] != DBNull.Value)
             {
                 Byte[] bytes = (Byte[])ds.Tables[0].Rows[0]["UD_Photo"];
                 Response.ContentType = "image/jpeg";
                 Response.BinaryWrite(bytes);
             }
         }
         catch (Exception exp)
         {
             Session["ERRTITLE"] = "Load Image Failed";
             Session["ERRDET"] = exp.Message;
             Response.Redirect("ErrorPage.aspx");
         }
} 

}
